package com.hwl.demo19.service.impl;

import com.hwl.demo19.entity.Request;
import com.hwl.demo19.service.Manager;

/**
 * 普通经理
 *
 * @author sentry
 * @since 2023-03-26
 */
public class CommonManager extends Manager {
    public CommonManager(String name) {
        super(name);
    }

    @Override
    public void requestApplications(Request request) {
        if ("请假".equals(request.getRequestType()) && request.getNumber() <= 2) {
            System.out.println(this.name + "：" + request.getRequestContent() + " 数量：" + request.getNumber() + "天，被批准");
        } else {
            if (this.superior != null) {
                this.superior.requestApplications(request);
            }
        }
    }
}
